function TbMsg(params){ 
	 
}

TbMsg.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new TbMsg.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new TbMsg.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new TbMsg.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.tbmId=function(tbmId){if(this.proxy)return this.getProxy().tbmId(tbmId);  this.put("tbmId", tbmId);return this;};
	/** and tbm_id is null */
	this.tbmIdNull=function(){if(this.proxy)return this.getProxy().tbmIdNull();if(this.get("tbmIdNot")==null)this.put("tbmIdNot", "");this.put("tbmId", null);return this;};
	/** not .... */
	this.tbmIdNot=function(){if(this.proxy)return this.getProxy().tbmIdNot();this.put("tbmIdNot", "not");return this;};
	this.tbmIdNotNull=function(){if(this.proxy)return this.getProxy().tbmIdNotNull();this.put("tbmIdNot", "not");this.put("tbmId", null);return this;};
	this.tbmIdNot=function(tbmId){if(this.proxy)return this.getProxy().tbmIdNot(tbmId);this.put("tbmIdNot", "not");this.put("tbmId", tbmId);return this;};
	/** and tbm_id <= ? */
	this.tbmIdMin=function(min){if(this.proxy)return this.getProxy().tbmIdMin(min);this.put("tbmIdMin", min);return this;};
	/** and tbm_id >= ? */
	this.tbmIdMax=function(max){if(this.proxy)return this.getProxy().tbmIdMax(max);this.put("tbmIdMax", max);return this;};
	this.tbmIdIn=function(ids){
		if(this.proxy)return this.getProxy().tbmIdIn(ids);  this.put("tbmIdIn", ids);return this;
	};	
	
	/** 会员        **/
	this.tbmMember=function(tbmMember){if(this.proxy)return this.getProxy().tbmMember(tbmMember);  this.put("tbmMember", tbmMember);return this;};
	/** and tbm_member is null */
	this.tbmMemberNull=function(){if(this.proxy)return this.getProxy().tbmMemberNull();if(this.get("tbmMemberNot")==null)this.put("tbmMemberNot", "");this.put("tbmMember", null);return this;};
	/** not .... */
	this.tbmMemberNot=function(){if(this.proxy)return this.getProxy().tbmMemberNot();this.put("tbmMemberNot", "not");return this;};
	this.tbmMemberNotNull=function(){if(this.proxy)return this.getProxy().tbmMemberNotNull();this.put("tbmMemberNot", "not");this.put("tbmMember", null);return this;};
	this.tbmMemberNot=function(tbmMember){if(this.proxy)return this.getProxy().tbmMemberNot(tbmMember);this.put("tbmMemberNot", "not");this.put("tbmMember", tbmMember);return this;};
	/** and tbm_member <= ? */
	this.tbmMemberMin=function(min){if(this.proxy)return this.getProxy().tbmMemberMin(min);this.put("tbmMemberMin", min);return this;};
	/** and tbm_member >= ? */
	this.tbmMemberMax=function(max){if(this.proxy)return this.getProxy().tbmMemberMax(max);this.put("tbmMemberMax", max);return this;};
	this.tbmMemberIn=function(ids){
		if(this.proxy)return this.getProxy().tbmMemberIn(ids);  this.put("tbmMemberIn", ids);return this;
	};	
	
	/** 内容        **/
	this.tbmContent=function(tbmContent){if(this.proxy)return this.getProxy().tbmContent(tbmContent);  this.put("tbmContent", tbmContent);return this;};
	/** and tbm_content is null */
	this.tbmContentNull=function(){if(this.proxy)return this.getProxy().tbmContentNull();if(this.get("tbmContentNot")==null)this.put("tbmContentNot", "");this.put("tbmContent", null);return this;};
	/** not .... */
	this.tbmContentNot=function(){if(this.proxy)return this.getProxy().tbmContentNot();this.put("tbmContentNot", "not");return this;};
	this.tbmContentNotNull=function(){if(this.proxy)return this.getProxy().tbmContentNotNull();this.put("tbmContentNot", "not");this.put("tbmContent", null);return this;};
	this.tbmContentNot=function(tbmContent){if(this.proxy)return this.getProxy().tbmContentNot(tbmContent);this.put("tbmContentNot", "not");this.put("tbmContent", tbmContent);return this;};
	
	/** 时间        **/
	this.tbmTime=function(tbmTime){if(this.proxy)return this.getProxy().tbmTime(tbmTime);  this.put("tbmTime", tbmTime);return this;};
	/** and tbm_time is null */
	this.tbmTimeNull=function(){if(this.proxy)return this.getProxy().tbmTimeNull();if(this.get("tbmTimeNot")==null)this.put("tbmTimeNot", "");this.put("tbmTime", null);return this;};
	/** not .... */
	this.tbmTimeNot=function(){if(this.proxy)return this.getProxy().tbmTimeNot();this.put("tbmTimeNot", "not");return this;};
	this.tbmTimeNotNull=function(){if(this.proxy)return this.getProxy().tbmTimeNotNull();this.put("tbmTimeNot", "not");this.put("tbmTime", null);return this;};
	this.tbmTimeNot=function(tbmTime){if(this.proxy)return this.getProxy().tbmTimeNot(tbmTime);this.put("tbmTimeNot", "not");this.put("tbmTime", tbmTime);return this;};
	/** and tbm_time >= ? */
	this.tbmTimeStart=function(start){if(this.proxy)return this.getProxy().tbmTimeStart(start);this.put("tbmTimeStart", start);return this;};			
	/** and tbm_time <= ? */
	this.tbmTimeEnd=function(end){if(this.proxy)return this.getProxy().tbmTimeEnd(end);this.put("tbmTimeEnd", end);return this;};
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有msg **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/users/msg.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取msg分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/users/msg.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取msg **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/users/msg.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

TbMsg.get = function(id){
	var protocol = ux.ajax("/admin/users/msg.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.tbMsg;
	return null;
}

TbMsg.where = new TbMsg.Where(0,true);